<h1>简介</h1>
ZF1，练手项目

<h1>加入OF错误工具方法</h1>
---------------start---------------
library/Zend/Exception.php
第51行
require_once APPLICATION_PATH . '/../public/of_error_tool/writeLog.php';
error_writeLog::phpLog($this);
---------------end---------------

---------------start---------------
library/Zend/Db/Exception.php
增加新的构造方法
public function __construct($msg = '', $code = 0, Exception $previous = null)
{
parent::__construct($msg, (int) $code, $previous);
require_once APPLICATION_PATH . '/../public/of_error_tool/writeLog.php';
if (empty($msg)) {
$dbAdapter = Zend_Db_Table::getDefaultAdapter();
$profiler = $dbAdapter->getProfiler();
$msg = $profiler->getLastQueryProfile()->getQuery();
}
error_writeLog::sqlLog(array('sql'=>$msg, 'code'=>$code));
}
---------------end---------------

---------------start---------------
library/Zend/Db/Adapter/Abstract.php
增加析构方法
public function __destruct() {
    $dbAdapter = Zend_Db_Table::getDefaultAdapter();
    $profiler = $dbAdapter->getProfiler();
    if ($profiler->getTotalElapsedSecs() > 1) {
    $queries = $profiler->getQueryProfiles();
    if ($queries){
    $sql = '';
    foreach ($queries as $query){
    $sql .= $query->getQuery().'   ';
    }
    require_once APPLICATION_PATH . '/../public/of_error_tool/writeLog.php';
    error_writeLog::sql1Log(array('sql'=>$sql, 'code'=>0));
    }
    }
}
---------------end---------------